<?php

namespace app\model;

use app\BaseModel;
use think\model\relation\BelongsTo;

/**
 * 教职工用户
 */
class WorkersUserModel extends BaseModel
{
    protected $name = 'workers_user';

    /**
     * 关联单位-单位名称
     * @return BelongsTo
     */
    public function unitName(): BelongsTo
    {
        return $this->belongsTo(UnitModel::class,'unit_id')->bind(['unit_name'=>'name']);
    }
}